<%--
  Created by IntelliJ IDEA.
  User: libing
  Date: 2016/7/23
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script id="allmobilize" charset="utf-8" src="${pageContext.request.contextPath }/js/home/allmobilize.min.js"></script>
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="alternate" media="handheld"  />
    <!-- end 云适配 -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>登录-微简历-最专业的互联网招聘平台</title>
    <meta property="qc:admins" content="23635710066417756375" />
    <meta content="微简历是3W旗下的互联网领域垂直招聘网站,互联网职业机会尽在拉勾网" name="description">
    <meta content="简历,微简历,微简历招聘,微,互联网招聘,微简历互联网招聘, 移动互联网招聘, 垂直互联网招聘, 微信招聘, 微博招聘, 微简历官网, 微简历百科,跳槽, 高薪职位, 互联网圈子, IT招聘, 职场招聘, 猎头招聘,O2O招聘, LBS招聘, 社交招聘, 校园招聘, 校招,社会招聘,社招" name="keywords">

    <meta name="baidu-site-verification" content="QIQ6KC1oZ6" />

    <link rel="Shortcut Icon" href="h/images/favicon.ico">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/home/style.css"/>

    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.1.10.1.min.js"></script>

    <script type="text/javascript" src="${pageContext.request.contextPath }/js/home/jquery.lib.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/home/core.min.js"></script>

</head>
<body id="login_bg">

<div class="header">
    <a href="${pageContext.request.contextPath }/admin/jumpToJsp.action">管理员登录</a>
</div>

<div class="login_wrapper">
    <div class="login_header">
        <a href="h/"><img src="${pageContext.request.contextPath }/images/home/logo_white.png" width="285" height="62" alt="微简历招聘" /></a>
        <div id="cloud_s"><img src="${pageContext.request.contextPath }/images/home/cloud_s.png" width="81" height="52" alt="cloud" /></div>
        <div id="cloud_m"><img src="${pageContext.request.contextPath }/images/home/cloud_m.png" width="136" height="95"  alt="cloud" /></div>
    </div>

    <div class="login_box">
        <form id="loginForm" action="">
            <input type="text" id="email" name="email" value="<c:choose><c:when test="${email != null}">${email}</c:when><c:otherwise></c:otherwise></c:choose>" tabindex="1" placeholder="请输入登录邮箱地址" />
            <input type="password" id="password" name="password" tabindex="2" placeholder="请输入密码" />
            <span class="error" style="display:none;" id="beError"></span>
            <label class="fl" for="remember"><input type="checkbox" id="remember" value="" checked="checked" name="autoLogin" /> 记住我</label>
            <a href="reset.html" class="fr" target="_blank">忘记密码？</a>

            <input type="submit" id="submitLogin" value="登 &nbsp; &nbsp; 录" />


        </form>
        <div class="login_right">
            <div>还没有微简历帐号？</div>
            <a  href="${pageContext.request.contextPath}/register/jumpToJsp.action"  class="registor_now">立即注册</a>
            <div class="login_others">使用以下帐号直接登录:</div>
            <a  href="h/ologin/auth/sina.html"  target="_blank" class="icon_wb" title="使用新浪微博帐号登录"></a>
            <a  href="h/ologin/auth/qq.html"  class="icon_qq" target="_blank" title="使用腾讯QQ帐号登录"></a>
        </div>
    </div>
    <div class="login_box_btm"></div>
</div>

<script type="text/javascript">
    $(function(){
        //验证表单
        $("#loginForm").validate({
            rules: {
                email: {
                    required: true,
                    email: true
                },
                password: {
                    required: true
                }
            },
            messages: {
                email: {
                    required: "请输入登录邮箱地址",
                    email: "请输入有效的邮箱地址，如：vivi@deplume.com"
                },
                password: {
                    required: "请输入密码"
                }
            },
            submitHandler:function(form){
                if($('#remember').prop("checked")){
                    $('#remember').val(1);
                }else{
                    $('#remember').val(null);
                }
                var email = $('#email').val();
                var password = $('#password').val();
                var remember = $('#remember').val();

                /*$(form).find(":submit").attr("disabled", true);*/
                $.ajax({
                    type:'post',
                    /*data:{email:email,password:password,autoLogin:remember, callback:callback, authType:authType, signature:signature, timestamp:timestamp},*/
                    url:'${pageContext.request.contextPath }/register/login.action',
                    /*data:{email:email,password:password},*/
                    data:'email='+email+'&password='+password,
                }).done(function(result) {
                    if(result.success){
                        window.location.href=result.jumpUrl;
                        //$('#loginForm').attr('action',result.jumpUrl).submit();
/*                      document.getElementById(loginForm).action = result.jumpUrl;
                        document.getElementById(loginForm).submit();*/
                    }else{
                        $('#beError').text(result.msg).show();
                    }
                    /*$(form).find(":submit").attr("disabled", false);*/
                });
            }
        });
    })
</script>
</body>
</html>

